package net.zoneland.data.dataprofiling.common.repository;

import net.zoneland.data.dataprofiling.common.domain.DictEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DictRepository extends JpaRepository<DictEntity,Long>, JpaSpecificationExecutor<DictEntity> {

    @Query("select distinct type,description from DictEntity")
    List<DictEntity> findDistinctTypeAndDescription();

    List<DictEntity> findByType(String type);

    List<DictEntity> findByTypeAndValue(String type,String value);

}
